<extend name="Public/base" />
<block name="body">
    <style>
        .Productlist li{
            width: 150px;
        //padding-right: 20px;
            margin-top: 20px;

        }
        .pdiv{
            min-height: 105px;
            background-color: #0000C0 !important;
        }
        .panel-body{
            min-height:500px;
        }

    </style>
    <div class="main-title" style="padding-bottom: 10px;">
        <h2> <span style='color: red;'>{$shopId|get_subpro_department_name}</span> 消耗品配货申请</h2>
    </div>
    <div class="cf">
        <div class="fl">

        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
        </div>
    </div>


    <div  class="row" ng-controller="SpBookproductCtrl">
        <div class="col-md-3 am-padding-0 am-margin-0" style=" padding-left: 0px;    padding-right: 0px;">
            <!------订货单--->
            <div class="panel panel-default"  id="dhplane">
                <div class="panel-heading">订货单创建</div>
                <div class="panel-body">

                    <table class="table table-striped">
                        <tr>
                            <th>请求配送的商品</th>
                            <th>数量</th>
                            <th>小计</th>
                            <th>单位</th>
                            <th></th>
                        </tr>
                        <tr ng-repeat="caigou in CaigouList">
                            <td ng-bind="caigou.pname"></td>
                            <td ><input type="text" ng-model="caigou.number"  ng-change="changenumber($index)"  style="width:50px;" /></td>
                            <td ng-bind="caigou.amountprice"></td>
                            <td ng-bind="caigou.unit"></td>
                            <td ><i class='glyphicon glyphicon-minus' ng-click="minusNumber($index)"></i></td>
                        </tr>

                    </table>

                    <table width='100%'>
                        <tr>
                            <td colspan='3'>
                                备注：
                                <textarea ng-model="remark" style='width:100%'></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                总数：<span ng-bind="totalLeixing"></span><br/>
                                总额：￥<span ng-bind="totalAmount"></span>
                            </td>
                            <td ><button type="button" class="btn btn-primary btn-lg" ng-click='creatBookproduct({$shopId})'>提交订货请求</button></td>
                        </tr>
                    </table>

                </div>
            </div>
        </div>
        <div class="col-md-9 am-padding-0 am-margin-0">
            <div class="panel panel-default am-padding-0 am-margin-0">
                <div class="panel-heading">
                    <ul class="nav nav-pills" role="tablist">
                        <volist name='_pcategorylist' id='vo'>
                            <li role="presentation"><a href="#" data-pcategoryid='{$vo.id}' ng-click="fenleiClick({$vo.id})">{$vo.name} </a></li>
                        </volist>
                    </ul>

                    <div class="input-group" >
                        <input id="searchText"  type="text" class="form-control" ng-model="searchText" placeholder="Search for..." onkeypress="if(event.keyCode==13) {document.getElementById('btnsearch').click();return false;}"/>
                        <span class="input-group-btn">
                            <button class="btn btn-default" ng-click="searchBtn()" id="btnsearch" type="button">查询</button>
                        </span>
                    </div><!-- /input-group -->

                </div>
                <div class="panel-body" >
                    <ul class="nav nav-pills Productlist " role="tablist">
                        <li  role="presentation" class="active" ng-repeat="product in ProductList" ng-click="addProduct(product.id, product.name, product.instockPrice,product.unit)">
                            <a class="pdiv"   href="#"   title="{{product.createat|date:'yyyy-MM-dd'}}">
                                <span class="label label-success" ng-show="isNew(product.createat)">新品</span>   <span ng-bind="product.name"></span>
                                <span ng-bind="product.cnt" class="badge"></span> <br/>
                                进价￥<span   ng-bind="product.instockPrice"></span><br/>
                                售价￥<span   ng-bind="product.sellPrice"></span>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript" src="__JS__/angularjs/SpBookproduct/bookprodutc.js"></script>
    <script type="text/javascript" src="__STATIC__/stickUp.min.js"></script>
    <script type="text/javascript">


        //搜索查询
        $('#submit').click(function () {
            document.getElementById("form-search").submit()
        });
        //导航高亮
        highlight_subnav('{:U('Subpro/outstorageindex')}');
    </script>
</block>

